﻿CREATE PROCEDURE [acms].[UserPostUpload_Delete]
	@Id int,
	@ConcurencyId rowversion
AS
	if exists(select null from [UserPostUpload_View] where Id = @Id and ConcurencyId = @ConcurencyId)
		update UserPostUpload
		set Deleted = 1
		where Id = @Id and ConcurencyId = @ConcurencyId
	else if exists(select null from [UserPostUpload_View] where Id = @Id)
		return -100
	else
		return -200
RETURN 0;